/*-----------------------------------------------------------*/
/*copyright by 动力无限  www.btoe.cn*/
/*邮箱 btoe@btoe.cn*/
/*合作电话 400-0599-360*/
/*版权所有违者必究*/
/*-----------------------------------------------------------*/

! function (t, i) {
    function s(i, s, n, a) {
        var e, r = i.text().split(s),
            o = "";
        r.length && (t(r).each(function (t, i) {
            e = "", " " === i && (e = " empty", i = "&nbsp;"), o += '<span class="' + n + (t + 1) + e + '">' + i + "</span>" + a
        }), i.empty().append(o))
    }
    /*!	
     * FitText.js 1.0
     *
     * Copyright 2011, Dave Rupert http://daverupert.com
     * Released under the WTFPL license 
     * http://sam.zoy.org/wtfpl/
     *
     * Date: Thu May 05 14:23:00 2011 -0600
     */
    t.fn.fitText = function (i, s) {
        var n = {
            minFontSize: Number.NEGATIVE_INFINITY,
            maxFontSize: Number.POSITIVE_INFINITY
        };
        return this.each(function () {
            var a = t(this),
                e = i || 1;
            s && t.extend(n, s);
            var r = function () {
                a.css("font-size", Math.max(Math.min(a.width() / (10 * e), parseFloat(n.maxFontSize)), parseFloat(n.minFontSize)))
            };
            r(), t(window).resize(r)
        })
    };
    var n = {
        init: function () {
            return this.each(function () {
                s(t(this), "", "char", "")
            })
        },
        words: function () {
            return this.each(function () {
                s(t(this), " ", "word", " ")
            })
        },
        lines: function () {
            return this.each(function () {
                var i = "eefec303079ad17405c889e092e105b0";
                s(t(this).children("br").replaceWith(i).end(), i, "line", "")
            })
        }
    };
    t.fn.lettering = function (i) {
        return i && n[i] ? n[i].apply(this, [].slice.call(arguments, 1)) : "letters" !== i && i ? (t.error("Method " + i + " does not exist on jQuery.lettering"), this) : n.init.apply(this, [].slice.call(arguments, 0))
    }, t.Arctext = function (i, s) {
        this.$el = t(s), this._init(i)
    }, t.Arctext.defaults = {
        radius: 0,
        dir: 1,
        rotate: !0,
        fitText: !1
    }, t.Arctext.prototype = {
        _init: function (i) {
            this.options = t.extend(!0, {}, t.Arctext.defaults, i), this._applyLettering(), this.$el.data("arctext", !0), this._calc(), this._rotateWord(), this._loadEvents()
        },
        _applyLettering: function () {
            this.$el.lettering(), this.options.fitText && this.$el.fitText(), this.$letters = this.$el.find("span").css("display", "inline-block")
        },
        _calc: function () {
            if (-1 === this.options.radius) return !1;
            this._calcBase(), this._calcLetters()
        },
        _calcBase: function () {
            this.dtWord = 0;
            var i = this;
            this.$letters.each(function (s) {
                var n = t(this),
                    a = n.outerWidth(!0);
                i.dtWord += a, n.data("center", i.dtWord - a / 2)
            });
            var s = this.dtWord / 2;
            this.options.radius < s && (this.options.radius = s), this.dtArcBase = this.dtWord;
            var n = 2 * Math.asin(this.dtArcBase / (2 * this.options.radius));
            this.dtArc = this.options.radius * n
        },
        _calcLetters: function () {
            var i = this,
                s = 0;
            this.$letters.each(function (n) {
                var a = t(this),
                    e = a.outerWidth(!0) / i.dtWord * i.dtArc / i.options.radius,
                    r = i.options.radius * Math.cos(e / 2),
                    o = Math.acos((i.dtWord / 2 - s) / i.options.radius) + e / 2,
                    c = Math.cos(o) * r,
                    h = Math.sin(o) * r,
                    d = s + Math.abs(i.dtWord / 2 - c - s),
                    u = 0 | d - a.data("center"),
                    l = 0 | i.options.radius - h,
                    f = i.options.rotate ? 0 | -Math.asin(c / i.options.radius) * (180 / Math.PI) : 0;
                s = 2 * d - s, a.data({
                    x: u,
                    y: 1 === i.options.dir ? l : -l,
                    a: 1 === i.options.dir ? f : -f
                })
            })
        },
        _rotateWord: function (i) {
            if (!this.$el.data("arctext")) return !1;
            var s = this;
            this.$letters.each(function (n) {
                var a = t(this),
                    e = -1 === s.options.radius ? "none" : "translateX(" + a.data("x") + "px) translateY(" + a.data("y") + "px) rotate(" + a.data("a") + "deg)",
                    r = i ? "all " + (i.speed || 0) + "ms " + (i.easing || "linear") : "none";
                a.css({
                    "-webkit-transition": r,
                    "-moz-transition": r,
                    "-o-transition": r,
                    "-ms-transition": r,
                    transition: r
                }).css({
                    "-webkit-transform": e,
                    "-moz-transform": e,
                    "-o-transform": e,
                    "-ms-transform": e,
                    transform: e
                })
            })
        },
        _loadEvents: function () {
            if (this.options.fitText) {
                var i = this;
                t(window).on("resize.arctext", function () {
                    i._calc(), i._rotateWord()
                })
            }
        },
        set: function (t) {
            if (!t.radius && !t.dir && "undefined" === t.rotate) return !1;
            this.options.radius = t.radius || this.options.radius, this.options.dir = t.dir || this.options.dir, t.rotate !== i && (this.options.rotate = t.rotate), this._calc(), this._rotateWord(t.animation)
        },
        destroy: function () {
            this.options.radius = -1, this._rotateWord(), this.$letters.removeData("x y a center"), this.$el.removeData("arctext"), t(window).off(".arctext")
        }
    };
    var a = function (t) {
        this.console && console.error(t)
    };
    t.fn.arctext = function (i) {
        if ("string" == typeof i) {
            var s = Array.prototype.slice.call(arguments, 1);
            this.each(function () {
                var n = t.data(this, "arctext");
                n ? t.isFunction(n[i]) && "_" !== i.charAt(0) ? n[i].apply(n, s) : a("no such method '" + i + "' for arctext instance") : a("cannot call methods on arctext prior to initialization; " + "attempted to call method '" + i + "'")
            })
        } else this.each(function () {
            t.data(this, "arctext") || t.data(this, "arctext", new t.Arctext(i, this))
        });
        return this
    }
}(jQuery);




jQuery(".productHot1ReasonBox").slide({
    titCell: ".productHot1ReasonListHd ul li",
    mainCell: ".bd .swiper-wrapper",
    effect: "left",
    autoPlay: true,
    vis: 1,
    prevCell: ".productHot1ReasonListHdJtL",
    nextCell: ".productHot1ReasonListHdJtR",
    trigger: "click",
    interTime: "6000"
});

jQuery(".productHot2chooseBox").slide({
    titCell: ".productHot2chooseLBox ul li",
    mainCell: ".productHot2chooseBd",
    effect: "left",
    autoPlay: true,
    vis: 1,
    prevCell: ".productHot2chooseRJtL",
    nextCell: ".productHot2chooseRJtR",
    trigger: "click",
    interTime: "6000"
});


jQuery(".productHot2CaseBox").slide({
    titCell: ".productHot2CaseBoxHd ul li",
    mainCell: ".productHot2CaseBoxBd",
    effect: "left",
    autoPlay: true,
    vis: 1,
    prevCell: ".productHot2chooseRJtL",
    nextCell: ".productHot2chooseRJtR",
    // trigger:"click",
    interTime: "6000"
});


$('.productHot2chooseL .productHot2chooseLBox ul li').on('click', function () {
    $('.productHot2chooseBox .productHot2chooseBoxNum i').text($(this).find('em').find('span').text())
})


$('.productHot2chooseRJtBox .productHot2chooseRJtL').on('click', function () {
    $('.productHot2chooseBox .productHot2chooseBoxNum i').text($('.productHot2chooseL .productHot2chooseLBox ul li.on').find('em').find('span').text())
})

$('.productHot2chooseRJtBox .productHot2chooseRJtR').on('click', function () {
    $('.productHot2chooseBox .productHot2chooseBoxNum i').text($('.productHot2chooseL .productHot2chooseLBox ul li.on').find('em').find('span').text())
})


if (window.innerWidth >= 1200) {

    $(".productHot1Product .productHot1title h4").show().arctext({
        radius: 230
    })

    $(".productHot1Reason .productHot1title h4").show().arctext({
        radius: 300
    })


    $(".productHot1Case .productHot1title h4").show().arctext({
        radius: 230
    })


    $(".productHot1News .productHot1title h4").show().arctext({
        radius: 150
    })

    $(".productHot1recommend .productHot1title h4").show().arctext({
        radius: 260
    })

    var productHot2relevant = new Swiper('.productHot2relevant .swiper-container', {
        slidesPerView: 4,
        paginationClickable: true,
        spaceBetween: 30,
        autoPlay: 5000,
        loop: true,
    });


    $(function () {
        $('.productHot1CaseBoxTop .productHot1CaseBoxText h5').html(function (i, html) {
            return '<i>' + $.trim(html).split('').join('</i><i>') + '</i>';
        });
    });

    var productHot1NewsBox = new Swiper('.productHot1NewsBox .swiper-container', {
        pagination: '.swiper-pagination',
        slidesPerView: 3,
        paginationClickable: true,
        spaceBetween: 1,
        loop: true,
        autoplay: 8000,
        prevButton: '.productHot1NewsBoxL',
        nextButton: '.productHot1NewsBoxR',
    });

    var productHot1recommendBox = new Swiper('.productHot1recommendBox .swiper-container', {
        pagination: '.swiper-pagination',
        slidesPerView: 3,
        paginationClickable: true,
        spaceBetween: 0,
        loop: true,
    });

    var productHot3CaseBox = new Swiper('.productHot3CaseBox .swiper-container', {
        pagination: '.productHot3CaseBoxJtBox',
        slidesPerView: 3,
        paginationClickable: true,
        spaceBetween: 30,
        loop: true,
        prevButton: '.productHot3CaseBoxJtL',
        nextButton: '.productHot3CaseBoxJtR',
    });

    var productHot3relevantBox = new Swiper('.productHot3relevantBox .swiper-container', {
        slidesPerView: 4,
        paginationClickable: true,
        spaceBetween: 30,
        loop: true,
        prevButton: '.productHot3CaseBoxJtL',
        nextButton: '.productHot3CaseBoxJtR',
    });
}


if (window.innerWidth < 1200) {
    var productHot1NewsBox = new Swiper('.productHot1NewsBox .swiper-container', {
        slidesPerView: 1,
        paginationClickable: true,
        spaceBetween: 1,
        loop: true,
        autoplay: 8000,
        prevButton: '.productHot1NewsBoxL',
        nextButton: '.productHot1NewsBoxR',
    });


    var productHot1recommend = new Swiper('.productHot1recommend .swiper-container', {
        slidesPerView: 1,
        paginationClickable: true,
        spaceBetween: 1,
        loop: true,
        autoplay: 8000,
    });


    var productHot2relevant = new Swiper('.productHot2relevant .swiper-container', {
        slidesPerView: 1,
        paginationClickable: true,
        spaceBetween: 30,
        autoPlay: 5000,
        loop: true,
    });


    var productHot3CaseBox = new Swiper('.productHot3CaseBox .swiper-container', {
        pagination: '.productHot3CaseBoxJtBox',
        slidesPerView: 1,
        paginationClickable: true,
        spaceBetween: 30,
        loop: true,
        prevButton: '.productHot3CaseBoxJtL',
        nextButton: '.productHot3CaseBoxJtR',
    });

    var productHot3relevantBox = new Swiper('.productHot3relevantBox .swiper-container', {
        slidesPerView: 1,
        paginationClickable: true,
        spaceBetween: 30,
        loop: true, 
    });
     $('#page').removeClass("goout");
    var flag = 1;
    $('.lcbody').click(function() {
        if( flag === 1) {
            $('body').addClass('open');
            $('#leftnav').show();
            flag = 0
        }else if(flag === 0) {
            $('body').removeClass('open');
            $('#leftnav').hide();
            flag = 1
        }
    })
    $('#main').click(function () {
        if (flag == 0) {
            $('body').removeClass('open');
            var t = setTimeout("$('#leftnav').hide()", 400)
            flag = 1;
        }
      
    })

    $('.goback').click(function () {
        if (window.history.length > 1) {
            window.history.go(-1)
        } else {
            window.location.href = '/'
        }
    })
    $('.productHot3 .productHot3advantages ul').wrap('<div class="swiper-container">')
    $('.productHot3 .productHot3advantages ul .swiper-container').wrap('<div class="productHot3advantagesBox">')
    $('.productHot3 .productHot3advantages ul').addClass('swiper-wrapper');
    $('.productHot3 .productHot3advantages ul li').addClass('swiper-slide');


    var productHot3advantages = new Swiper('.productHot3advantages .swiper-container', {
        slidesPerView: 1,
        paginationClickable: true,
        spaceBetween: 30,
        loop: true, 
    });
}


$(function () {
    $('.productHot1MessageRBth').on('click', function () {
        var kcontent = $('.productHot1MessageRConent').val(); //内容
        var kuser = $('.productHot1MessageRName').val(); //名字
        var kphone = $('.productHot1MessageRTel').val(); //电话
        var kcode = $('.productHot1MessageRQrText').val().trim(); //验证码的input 
        // var kemail = $('.useremail').val();
        var reg = /(^(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$)|(^((\(\d{3}\))|(\d{3}\-))?(1[3578]\d{9})$)|(^400[0-9]{7})/;
        if (kuser == "") {
            alert('姓名不能为空！')
            $(".productHot1MessageRName").focus();
            return false;
        }
        if (kphone == "") {
            alert('号码不能为空！')
            $(".productHot1MessageRTel").focus();
            return false;
        }
        if (!reg.test(kphone)) {
            alert('号码填写有误！')
            $(".productHot1MessageRTel").focus();
            return false;
        }
        if (kcontent == "" || kcontent.length < 10) {
            alert('留言内容必须大于10字！')
            $(".productHot1MessageRConent").focus();
            return false;
        }

        if (kcode == "") { //验证码的input 
            alert('验证码不能为空')
            $(".productHot1MessageRQrText").focus();
            return false;
        }

        $.post('/api/message.ashx?action=add', {
            "kcontent": kcontent,
            "kuser": kuser,
            "kphone": kphone,
            "kcode": kcode //验证码的程序调用 
        }, function (res) {
            if (res == 1) {
                alert("留言提交成功");
                $('.productHot1MessageRConent').val('');
                $('.productHot1MessageRName').val('');
                $('.productHot1MessageRTel').val('');
                $('.productHot1MessageRQrText').val('');
            } else {
                alert("留言提交失败")
            }
        })
    })

    $('.productHot2MessageBottomBth').on('click', function () {
        var kcontent = $('.productHot2MessageTopContent').val(); //内容
        var kuser = $('.productHot2MessageTopName').val(); //名字
        var kphone = $('.productHot2MessageTopTel').val(); //电话
        var kcode = $('.productHot2MessageQrcodeText').val().trim(); //验证码的input 
        // var kemail = $('.useremail').val();
        var reg = /(^(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$)|(^((\(\d{3}\))|(\d{3}\-))?(1[3578]\d{9})$)|(^400[0-9]{7})/;
        if (kuser == "") {
            alert('姓名不能为空！')
            $(".productHot2MessageTopName").focus();
            return false;
        }
        if (kphone == "") {
            alert('号码不能为空！')
            $(".productHot2MessageTopTel").focus();
            return false;
        }
        if (!reg.test(kphone)) {
            alert('号码填写有误！')
            $(".productHot2MessageTopTel").focus();
            return false;
        }
        if (kcontent == "" || kcontent.length < 10) {
            alert('留言内容必须大于10字！')
            $(".productHot2MessageTopContent").focus();
            return false;
        }

        if (kcode == "") { //验证码的input 
            alert('验证码不能为空')
            $(".productHot2MessageQrcodeText").focus();
            return false;
        }

        $.post('/api/message.ashx?action=add', {
            "kcontent": kcontent,
            "kuser": kuser,
            "kphone": kphone,
            "kcode": kcode //验证码的程序调用 
        }, function (res) {
            if (res == 1) {
                alert("留言提交成功");
                $('.productHot2MessageTopContent').val('');
                $('.productHot2MessageTopName').val('');
                $('.productHot2MessageTopTel').val('');
                $('.productHot2MessageQrcodeText').val('');
            } else {
                alert("留言提交失败")
            }
        })
    })

    $('.productHot3MessageBoxBthR').on('click', function () {
        var kcontent = $('.productHot3MessageBoxContent').val(); //内容
        var kuser = $('.productHot3MessageBoxName').val(); //名字
        var kphone = $('.productHot3MessageBoxTel').val(); //电话
        var kcode = $('.productHot3MessageBoxQrcodeText').val().trim(); //验证码的input 
        // var kemail = $('.useremail').val();
        var reg = /(^(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$)|(^((\(\d{3}\))|(\d{3}\-))?(1[3578]\d{9})$)|(^400[0-9]{7})/;
        if (kuser == "") {
            alert('姓名不能为空！')
            $(".productHot3MessageBoxName").focus();
            return false;
        }
        if (kphone == "") {
            alert('号码不能为空！')
            $(".productHot3MessageBoxTel").focus();
            return false;
        }
        if (!reg.test(kphone)) {
            alert('号码填写有误！')
            $(".productHot3MessageBoxTel").focus();
            return false;
        }
        if (kcontent == "" || kcontent.length < 10) {
            alert('留言内容必须大于10字！')
            $(".productHot3MessageBoxContent").focus();
            return false;
        }

        if (kcode == "") { //验证码的input 
            alert('验证码不能为空')
            $(".productHot3MessageBoxQrcodeText").focus();
            return false;
        }

        $.post('/api/message.ashx?action=add', {
            "kcontent": kcontent,
            "kuser": kuser,
            "kphone": kphone,
            "kcode": kcode //验证码的程序调用 
        }, function (res) {
            if (res == 1) {
                alert("留言提交成功");
                $('.productHot3MessageBoxContent').val('');
                $('.productHot3MessageBoxName').val('');
                $('.productHot3MessageBoxTel').val('');
                $('.productHot3MessageBoxQrcodeText').val('');
            } else {
                alert("留言提交失败")
            }
        })
    })
})

//验证码刷新
$(".productHot1MessageRQrcodeBoxCODE").click(function () { //验证码图片刷新
    $(this)[0].src = '/api/message.ashx?action=code&' + Math.random()
});
//验证码刷新
$(".productHot2MessageQrcode").click(function () { //验证码图片刷新
    $(this)[0].src = '/api/message.ashx?action=code&' + Math.random()
});

$(".productHot3MessageBoxQrcode").click(function () { //验证码图片刷新
    $(this)[0].src = '/api/message.ashx?action=code&' + Math.random()
});


$('.alertCenter').click(function(){
    $('.alertMenu').stop().slideToggle();

})


$('.proListMenuTOPAlertMenuCenter .proListMenuTOPAlertMenuCenterList').click(function(){
    $(this).toggleClass('proListMenuTOPAlertMenuCenterList1');
    $(this).find('ul').slideToggle();
})

  
$('#leftnav ul li .navOne').on('click',function(){
      $(this).toggleClass('navOne1')
      $(this).next('ul').slideToggle();
  })